package models;

import java.util.ArrayList;
import java.util.Date;

import siena.*;

public class Template extends Model{
	
	@Id(Generator.AUTO_INCREMENT)
	private Long id;
	@NotNull
	private String name;
	private String description;
	private User user;
	@NotNull
	public ArrayList<Integer> tabs;
	private Date created;
	private Date modified;
	private static int count;
	
	public Template(String name){
		super();
		this.name = name;
		tabs = new ArrayList<Integer>();
		this.created = new Date();
		this.modified = created;
		count++;
	}
	
	public Template(String name, String description){
		super();
		this.name = name;
		this.description = description;
		tabs = new ArrayList<Integer>();
		this.created = new Date();
		this.modified = created;
		count++;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public ArrayList<Integer> getTabs() {
		return tabs;
	}

	public void setTabs(ArrayList<Integer> tabs) {
		this.tabs = tabs;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getModified() {
		return modified;
	}

	public void setModified(Date modified) {
		this.modified = modified;
	}

	public static int getCount() {
		return count;
	}

	public static void setCount(int count) {
		Template.count = count;
	}
	
	
	//When creating a new Customized tab add it's id (the one we create) to the tabs arraylist here.
}
